package com.zxkj.domain.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;

@Embeddable
public class SciMapAuAdPK implements Serializable {
    public SciMapAuAdPK() {
    }

    public SciMapAuAdPK(String auId, String adId) {
        this.auId = auId;
        this.adId = adId;
    }

    private static final long serialVersionUID = -2432145316543676L;
    @Column(nullable = false)
    private String auId;
    @Column(nullable = false)
    private String adId;

    public String getAuId() {
        return auId;
    }

    public void setAuId(String auId) {
        this.auId = auId;
    }

    public String getAdId() {
        return adId;
    }

    public void setAdId(String adId) {
        this.adId = adId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SciMapAuAdPK that = (SciMapAuAdPK) o;

        if (auId != null ? !auId.equals(that.auId) : that.auId != null) return false;
        return adId != null ? adId.equals(that.adId) : that.adId == null;
    }

    @Override
    public int hashCode() {
        int result = auId != null ? auId.hashCode() : 0;
        result = 31 * result + (adId != null ? adId.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "SciMapAuAdPK{" +
                "auId='" + auId + '\'' +
                ", adId=" + adId +
                '}';
    }
}
